#ifndef AVALON_MESSAGE_HPP
#define AVALON_MESSAGE_HPP
#include <boost/signals2.hpp>
#include "Avalon/IO/IO.hpp"
#include "Avalon/Serialization/Serialization.hpp"
#include "Avalon/Services/Services.hpp"

namespace Avalon {
namespace Services {

  /*! \class Message
   *  \brief Abstract base class for a message.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class Message {
    public:

      virtual ~Message();

    protected:

      //! Emits a ServiceNode's signal for this Message.
      /*!
        \param signal The signal to emit.
        \param serviceNode The ServiceNode to emit the <i>signal</i> for.
        \param channel The Channel on which the Message was received.
      */
      virtual void EmitSignal(boost::signals2::signal_base* signal,
        ServiceNode* serviceNode, IO::Channel* channel) = 0;

      virtual void Shuttle(Serialization::DataShuttle* shuttle,
        unsigned int version) = 0;

    private:
      friend class Serialization::DataShuttle;
      friend class ServiceNode;
  };
}
}

#endif // AVALON_MESSAGE_HPP
